package Testing;

import java.util.*; 
import java.text.*;

public class ToolChen {
	
 

public static int daysOfTwoDate(Date beginDate,Date endDate){  
    int days = 0;
      DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  

    Calendar beginCalendar = Calendar.getInstance();  
    Calendar endCalendar = Calendar.getInstance();  
      
    beginCalendar.setTime(beginDate);  
    endCalendar.setTime(endDate);  
    
    while(beginCalendar.before(endCalendar)){  
        days++;  
        beginCalendar.add(Calendar.DAY_OF_MONTH, 1);  
    }  
    return days;  
}

public static  Date test(String s)
{
	String s1,s2,s3;
	int i1,i2,i3;
	s1 = s.substring(0, 3);
	s2 = s.substring(4,5);
	s3 = s.substring(6,7);
	i1 = Integer.parseInt(s1);
			i2 = Integer.parseInt(s3);
					i3 = Integer.parseInt(s3);

				Calendar c1 = Calendar.getInstance();
				c1.set(i1, i2, i3);
				return c1.getTime();
}
}
